﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;

namespace XQ.Common.Test
{
    //public class Perssion : FilterAttribute, IActionFilter, IResultFilter
    //{
    //}


    //public class MyFilter1 : FilterAttribute, IActionFilter, IResultFilter, IAuthorizationFilter
    //{
    //    public string Target { get; set; }
    //    #region IActionFilter 成员

    //    public void OnActionExecuted(ActionExecutedContext filterContext)
    //    {
    //        filterContext.HttpContext.Response.Write("<div>这是应用在" + Target + "上面的MyFilter1中OnActionExecuted方法添加的内容！</div>");
    //    }

    //    public void OnActionExecuting(ActionExecutingContext filterContext)
    //    {
    //        filterContext.HttpContext.Response.Write("<div>这是应用在" + Target + "上面的MyFilter1中OnActionExecuting方法添加的内容！</div>");
    //    }

    //    #endregion

    //    #region IResultFilter 成员

    //    public void OnResultExecuted(ResultExecutedContext filterContext)
    //    {
    //        filterContext.HttpContext.Response.Write("<div>这是应用在" + Target + "上面的MyFilter1中OnResultExecuted方法添加的内容！</div>");
    //    }

    //    public void OnResultExecuting(ResultExecutingContext filterContext)
    //    {
    //        filterContext.HttpContext.Response.Write("<div>这是应用在" + Target + "上面的MyFilter1中OnResultExecuting方法添加的内容！</div>");
    //    }

    //    #endregion

    //    #region IAuthorizationFilter 成员

    //    public void OnAuthorization(AuthorizationContext filterContext)
    //    {
    //        filterContext.HttpContext.Response.Write("<div>这是应用在" + Target + "上面的MyFilter1中OnAuthorization方法添加的内容！</div>");
    //    }

    //    #endregion
    //}

    //public class MyFilter2 : FilterAttribute, IActionFilter, IResultFilter, IAuthorizationFilter
    //{
    //    public string Target { get; set; }
    //    #region IActionFilter 成员

    //    public void OnActionExecuted(ActionExecutedContext filterContext)
    //    {
    //        filterContext.HttpContext.Response.Write("<div>这是应用在" + Target + "上面的MyFilter2中OnActionExecuted方法添加的内容！</div>");
    //    }

    //    public void OnActionExecuting(ActionExecutingContext filterContext)
    //    {
    //        filterContext.HttpContext.Response.Write("<div>这是应用在" + Target + "上面的MyFilter2中OnActionExecuting方法添加的内容！</div>");
    //    }

    //    #endregion

    //    #region IResultFilter 成员

    //    public void OnResultExecuted(ResultExecutedContext filterContext)
    //    {
    //        filterContext.HttpContext.Response.Write("<div>这是应用在" + Target + "上面的MyFilter2中OnResultExecuted方法添加的内容！</div>");
    //    }

    //    public void OnResultExecuting(ResultExecutingContext filterContext)
    //    {
    //        filterContext.HttpContext.Response.Write("<div>这是应用在" + Target + "上面的MyFilter2中OnResultExecuting方法添加的内容！</div>");
    //    }

    //    #endregion

    //    #region IAuthorizationFilter 成员

    //    public void OnAuthorization(AuthorizationContext filterContext)
    //    {
    //        filterContext.HttpContext.Response.Write("<div>这是应用在" + Target + "上面的MyFilter2中OnAuthorization方法添加的内容！</div>");
    //    }

    //    #endregion
    //}
}
